package net.wsfcp.android.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import net.wsfcp.android.R;
import net.wsfcp.android.bean.resultbean.DrawerBean;

import java.util.List;

//侧边栏
public class DrawerAdapter extends CommonAdapter {


    public DrawerAdapter(Context context, int layoutId, List datas) {
        super(context, layoutId, datas);
    }

    @Override
    protected void convert(ViewHolder mHolder, Object o, int position) {
        DrawerBean.ChannelList bean = (DrawerBean.ChannelList) o;
        mHolder.setText(R.id.txt_drawer_title, bean.getName());
        Glide.with(mContext).load( bean.getWapIconUri()).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher)).into((ImageView) mHolder.getView(R.id.img_drawer_icon));

    }


}
